/*
 * @Author: songtao
 * @Date: 2021-11-03 19:11:38
 * @LastEditTime: 2021-11-12 19:18:31
 * @FilePath: \vue-cars\vue-admin\src\router\index.js
 */
import Vue from "vue";
import VueRouter from "vue-router";
import Layout from "@/views/Layout/index.vue"

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "login",
    hidden: true,
    meta: {
      name:"主页"
    }
  },
  {
    path: "/login",
    name: "Login",
    hidden: true,
    meta: {
      name:"登录"
    },
    component: () => import("../views/Login/index.vue"),
  },
  {
    path: "/console",
    name: "Console",
    redirect:"index",
    meta: {
      name:"首页",
      icon:"el-icon-s-home"
    },
    component: Layout,
    children:[
      {
        path: "/index",
        name: "Index",
        meta: {
          name:"控制台"
        },
        component: () => import("../views/Console/index.vue")
      }
    ]
  },
  {
    path: "/info",
    name: "Info",
    meta: {
      name:"信息",
      icon:"el-icon-info"
    },
    component: Layout,
    children:[
      {
        path: "/infoIndex",
        name: "InfoIndex",
        meta: {
          name:"信息列表"
        },
        component: () => import("../views/Info/infoIndex.vue")
      },
      {
        path: "/infoType",
        name: "InfoType",
        meta: {
          name:"信息分类"
        },
        component: () => import("../views/Info/infoType.vue")
      }
    ]
  },
  {
    path: "/user",
    name: "User",
    meta: {
      name:"用户",
      icon:"el-icon-user"
    },
    component: Layout,
    children:[
      {
        path: "/userIndex",
        name: "UserIndex",
        meta: {
          name:"用户列表"
        },
        component: () => import("../views/User/userIndex.vue")
      }
    ]
  }
];

const router = new VueRouter({
  routes,
});

export default router;
